

#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>
//#import "FFCaptureDelegate.h"
#import "FFScanConfig.h"
#import "FFScanResult.h"

@interface FFCaptureViewController : UIViewController

#pragma mark - Managing the Delegate
// 二维码读取代理
//@property (nonatomic, weak) id<FFCaptureDelegate> delegate;

#pragma mark - Creating and Inializing QRCode Readers


-(id)initWithScanConfig:(FFScanConfig*)config resultCallBack:(void (^)(FFScanResult *result))callback;


/**
 *  初始化控制器，必须有扫描配置对象
 *
 *  @param config 扫描配置对象
 *
 *  @return self
 */
- (instancetype)initWithConfig:(FFScanConfig *)config;
/**
 *  自定义放回按钮标题内容
 *
 *  @param cancelTitle 标题内容
 *
 *  @return 本身
 */
- (id)initWithCancelButtonTitle:(NSString *)cancelTitle;

/**
 *  自定义返回按钮标题内容
 *
 *  @param cancelTitle 标题内容
 *
 *  @return 本身
 */
+ (instancetype)readerWithCancelButtonTitle:(NSString *)cancelTitle;

#pragma mark - Checking the Metadata Items Types
/**
 *  检查当前设备是否支持扫描二维码
 *
 *  @return Yes - 支持，No - 不支持
 */
+ (BOOL)isAvailable;

#pragma mark - Managing the Block
/**
 *  当二维码完成后回调
 *
 *  @param completionBlock 回调block，resultAsString:扫描结果
 */
- (void)setCompletionWithBlock:(void (^) (NSString *resultAsString,NSString * type))completionBlock;

@end
